﻿using Net8.DependencyInjection.InterFace;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Net8.DependencyInjection.Model
{
    [My]
    public class ProductService: IProductService
    {
        #region 构造函数
        //public ProductRepository ProductRepository;
        //public ProductService(ProductRepository productRepository)
        //{
        //    ProductRepository = productRepository;
        //}
        #endregion
        #region 接口注册
        //public IProductRepository ProductRepository;
        //public ProductService(IProductRepository productRepository)
        //{
        //    ProductRepository = productRepository;
        //}
        #endregion

        #region 属性注册
        public IProductRepository ProductRepository { get; set; }
        #endregion

        public void GetProduct()
        {
            ProductRepository?.GetProductRepository();
            Console.WriteLine("查询商品成功");
            Console.WriteLine(this.GetHashCode());
        }
    }
}
